package com.ayou.session.defaults;

import com.ayou.session.Configuration;
import com.ayou.session.SqlSession;
import com.ayou.session.SqlSessionFactory;

/**
 * @description:
 * @author: ayouman
 * @date: 2024/7/2 14:55
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {
    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration, configuration.newExecutor());
    }
}
